package com.rest.common.config;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component;
import java.io.InputStream;
import java.util.Properties;

@Component
public class InitializeApplication implements ApplicationListener<ContextRefreshedEvent> {
    private Logger logger = LoggerFactory.getLogger(InitializeApplication.class);
    public static String BASE_FILE_PATH ="/tmp" ;
    @Override
    public void onApplicationEvent(ContextRefreshedEvent event) {
        logger.info("系统初始化...");
        try {
//            String os = System.getProperty("os.name");
//            InputStream in = this.getClass().getResourceAsStream("/application.properties");
//            Properties props = new Properties();
//            props.load(in);
//            BASE_FILE_PATH = (String) props.get("linux_uploadPath");
            logger.info("系统初始化结束");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
